<extend name="public:template" />
<block name="title">IP黑名单</block>
<block name="content">
    <div class="wrap-page">
        <div id="pageConfigSite" class="page-content">
            <include file="public:subtabs"/>
            <form class="form default-style" role="form" id="setting_site_form" action="{:u('backend/settings/blackip')}" method="post">
                <div id="boxConfigSite" class="box">
                    <div class="box-content">

                        <dl class="clearfix">
                            <dt><label>IP黑名单：</label></dt>
                            <dd>
                                <div class="item-field clearfix">
                                    <textarea  class="textarea" style="width: 550px; height: 150px;" id="ip" name="ip" rows="25"  placeholder="请输入禁止IP，多个用,隔开">{$black_list}</textarea>
                                </div>
                                <div class="item-prompt">提示：过个IP以 , 号隔开</div>
                            </dd>
                        </dl>

                        <dl class="clearfix">

                        </dl>

                    </div>
                </div>
                <div class="page-buttons clearfix">
                    <div class="fl-l">
                        <button type="button" class="save button button-blue">保存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</block>

<block name="script">
    <script>
        $(document).ready(function(){

            $('.save').click(function(){
                //数据验证
                $.ajax({
                    type: "POST",
                    url: $('.form').attr('action'),
                    data: $('.form').serialize(),
                    dataType: "json",
                    success:function(data){
                        if(data.status)
                        {
                            layer.msg(data.msg,{icon: 1,time:2000, shade: [0.1, '#ccc']});
                        } else {
                            layer.msg(data.msg,{icon: 2,time:2000, shade: [0.1, '#ccc']})
                        }
                    }
                });
                return false;
            });
        });
    </script>
</block>